﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Medical.Business;

public partial class control_Case : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string strInfo = string.Empty;
            //典型病例
            DataTable dtCase = new BisArticle().GetTopArticle(7, ArticelTypeEnum.Case, 57);
            if (dtCase.Rows.Count > 0)
            {
                ltlCase.Text = "<a href=\"" + Until.GetUrlName(dtCase.Rows[0]["PSortUrlName"], dtCase.Rows[0]["SortUrlName"], dtCase.Rows[0]["ID"]) + "\" title=\"" + dtCase.Rows[0]["Name"].ToString() + "\" target=\"_blank\">" + Server.HtmlEncode(dtCase.Rows[0]["Name"].ToString()) + "</a>";
                strInfo = Common.NoHTML(dtCase.Rows[0]["Info"].ToString());
                ltlCaseInfo.Text = (strInfo.Length > 80 ? strInfo.Substring(0, 80) : strInfo) + "…" +
                             "<a href=\"" + Until.GetUrlName(dtCase.Rows[0]["PSortUrlName"], dtCase.Rows[0]["SortUrlName"], dtCase.Rows[0]["ID"]) + "\" title=\"" + dtCase.Rows[0]["Name"].ToString() + "\" target=\"_blank\">[查看详情]</a>";
                dtCase.Rows.RemoveAt(0);
                dtCase.AcceptChanges();
            }
            rptCase.DataSource = dtCase;
            rptCase.DataBind();
            dtCase.Dispose();
        }
    }
}